﻿@model IEnumerable<Scap.Info.ScapDepartment>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>Id</th>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            Tipo
            @*Html.DisplayNameFor(model => model.Type.Name)*@
        </th>
         <th>Typeid</th>
       <th>
            Dirección
            @*Html.DisplayNameFor(model => model.Address.Name)*@
        </th>
        <th>Direccionid</th>
        <th>
            Departamento Padre
            @*Html.DisplayNameFor(model => model.ParentDepartment.Name)*@
        </th>
        <th>Padreid</th>
        <th>
            Compañia
            @*Html.DisplayNameFor(model => model.Company.Name)*@
        </th>
        <th>Compañiaid</th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @item.Id
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Type.Name)
        </td>
        <td>@Html.DisplayFor(modelItem => item.TypeId)</td>
        <td>
            @Html.DisplayFor(modelItem => item.Address.Name)
        </td>
        <td>@Html.DisplayFor(moedlItem => item.AddressId)</td>
        <td>
            @Html.DisplayFor(modelItem => item.ParentDepartment.Name)
        </td>
        <td>@Html.DisplayFor(modelItem => item.ParentDepartmentId)</td>
        <td>
            @Html.DisplayFor(modelItem => item.Company.Name)
        </td>
        <td>@Html.DisplayFor(modelItem => item.CompanyId)</td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}

</table>
